<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="f" uri="http://java.sun.com/jstl/functions" %>

<c:if test="${!empty messageKey}">
	<div class="alert alert-${messageType}">
	  <button type="button" class="close" data-dismiss="alert">&times;</button>
	  <p id="message">
	  	${message}
	  </p>
	</div>
</c:if>

<table id="eventList" class="table table-striped">
	<thead>
		<tr>
			<th>Nome do Fundo</th>
			<th>Status</th>
			<th>Detalhes</th>
			<th>Editar</th>
			<th>Exportar</th>
		</tr>
	</thead>
	<tbody>
		<c:choose>
			<c:when test="${empty funds}">
				<tr>
					<td colspan="5">Nenhum Fundo foi identificado</td>
				</tr>			
			</c:when>
			<c:otherwise>
				<c:forEach items="${funds}" var="fund">
					<tr>
						<td>${fund.event.name}</td>
						<td>
							<c:if test="${fund.status}">
								Ativado
							</c:if>
							<c:if test="${!fund.status}">
								Desativado
							</c:if>
						</td>
						<td>
							<a href="${url}fund/details/${fund.id}/"> 
								<img src="${urlImg}details.png" alt="Detalhes" title="Detalhes">
							</a> 
						</td>
						<td>
							<a href="${url}fund/edit/${fund.id}/"> 
								<img src="${urlImg}edit.png" alt="Editar" title="Editar">
							</a> 
						</td>
						<td>
							<a href="${url}export/minhasEconomias/${fund.id}/"> 
								<img src="${urlImg}minhasEconomias.png" alt="Minhas Economias" title="Minhas Economias" width="32">
							</a> 
						</td>
					</tr>
				</c:forEach>
			</c:otherwise>
		</c:choose>
	</tbody>
</table>